+Sat Mar 2 22:11:10 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk-pixbuf-io.c (_gdk_pixbuf_load_module): If we
+ can't load the module using the g_module_build_path()
+ filename, try loading it as a .la file.
+
+ * test-loaders.c: Look for modules in current directory
+ rather than .libs, so we find the right .la files.
+
+ * test-loaders.c: Back out some accidental commits.
+
Sat Mar 2 21:28:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk-pixbuf.c (gdk_pixbuf_new): Bullet-proof against integer
* gdk-pixdata.c (gdk_pixdata_to_csource): Use {} not
() to group around string assigned to char[]. (#72767,
- Tomas Ã\96gren)
+ Tomas Ögren)
2002-02-21 Havoc Pennington <hp@pobox.com>
2000-06-05 Mathieu Lacage <mathieu@gnome.org>
* configure.in: add some gtk parameters to the
- GDK_PIXBUF_LIBÃ\82²S and GDK_PIXBUG_INCLUDEDIR vars. One more
+ GDK_PIXBUF_LIBÃ�²S and GDK_PIXBUG_INCLUDEDIR vars. One more
fight in my crusade for strange prefix compile...
2000-05-30 Not Zed <NotZed@HelixCode.com>
* gdk-pixbuf/Makefile.am (INCLUDES): Add $(GNOME_CFLAGS).
Reported by Jens Finke.
-2000-04-14 Tomasz KÃ\82³opczko <kloczek@pld.org.pl>
+2000-04-14 Tomasz KÃ�³opczko <kloczek@pld.org.pl>
* gdk-pixbuf/pixops/makefile.am: $(LIBART_CFLAGS) replaced by
$(GTK_CFLAGS) - now gdk-pixbuf compiles correctly.
#endif
+/* Like g_module_path, but use .la as the suffix
+ */
+static gchar*
+module_build_la_path (const gchar *directory,
+ const gchar *module_name)
+{
+ gchar *filename;
+ gchar *result;
+
+ if (strncmp (module_name, "lib", 3) == 0)
+ filename = (gchar *)module_name;
+ else
+ filename = g_strconcat ("lib", module_name, ".la", NULL);
+
+ if (directory && *directory)
+ result = g_build_filename (directory, filename, NULL);
+ else
+ result = g_strdup (filename);
+
+ if (filename != module_name)
+ g_free (filename);
+
+ return result;
+}
+
/* actually load the image handler - gdk_pixbuf_get_module only get a */
/* reference to the module to load, it doesn't actually load it */
/* perhaps these actions should be combined in one function */
* itself.
*/
dir = g_getenv ("GDK_PIXBUF_MODULEDIR");
+ if (dir == NULL || *dir == '\0')
+ dir = PIXBUF_LIBDIR;
- if (dir == NULL || *dir == '\0') {
-
- path = g_module_build_path (PIXBUF_LIBDIR, module_name);
- module = g_module_open (path, G_MODULE_BIND_LAZY);
- } else {
- path = g_module_build_path (dir, module_name);
- module = g_module_open (path, G_MODULE_BIND_LAZY);
- }
+ path = g_module_build_path (dir, module_name);
+ module = g_module_open (path, G_MODULE_BIND_LAZY);
+ if (!module) {
+ g_free (path);
+ path = module_build_la_path (dir, module_name);
+ module = g_module_open (path, G_MODULE_BIND_LAZY);
+ }
+
if (!module) {
+ g_free (path);
+ path = g_module_build_path (dir, module_name);
+
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_FAILED,
static gpointer
limited_try_malloc (gsize n_bytes)
{
- gpointer mem = malloc (n_bytes + HEADER_SPACE);
- //fprintf (stderr, "malloced %p\n", mem);
-
- return record_bytes (mem, n_bytes);
+ return record_bytes (malloc (n_bytes + HEADER_SPACE), n_bytes);
}
static gpointer
int bytes = n_blocks * n_block_bytes + HEADER_SPACE;
gpointer mem = malloc (bytes);
memset (mem, 0, bytes);
-
- //fprintf (stderr, "calloced %p\n", mem);
-
return record_bytes (mem, n_blocks * n_block_bytes);
}
limited_free (gpointer mem)
{
gpointer real = ((char*)mem) - HEADER_SPACE;
- gint new_allocation;
-
- // fprintf (stderr, "Freeing %p\n", real);
g_assert (current_allocation >= 0);
- new_allocation = current_allocation - GPOINTER_TO_INT (*(void**)real);
- g_assert (new_allocation >= 0);
- current_allocation = new_allocation;
+ current_allocation -= GPOINTER_TO_INT (*(void**)real);
+ g_assert (current_allocation >= 0);
free (real);
}
putenv ("GDK_PIXBUF_MODULEDIR="BUILT_MODULES_DIR);
- #if 0
TEST (valid_ppm_1, TRUE);
TEST (valid_ppm_2, TRUE);
TEST (valid_ppm_3, FALSE); /* image is valid, but we don't handle maxval > 255 */
TEST (valid_ico_test, TRUE);
TEST (ico_test_1, FALSE);
- // TEST (ico_test_2, FALSE);
+ TEST (ico_test_2, FALSE);
TEST (valid_jpeg_test, TRUE);
TEST (valid_tiff1_test, TRUE);
TEST (tiff1_test_1, FALSE);
TEST (tiff1_test_2, FALSE);
-#endif
+#if 0
TEST (tiff1_test_3, FALSE); /* Segfault in TIFFReadDirectory with libtiff 3.5.5, fixed in 3.5.7 */
+#endif
-#if 0
TEST (valid_tga_test, TRUE);
TEST (tga_test_1, FALSE);
TEST_RANDOMLY_MODIFIED (valid_tga_test, FALSE);
TEST_RANDOMLY_MODIFIED (valid_jpeg_test, FALSE);
TEST_RANDOMLY_MODIFIED (valid_ico_test, FALSE);
-#endif
+
/* memory tests */
returns successfully, even though they have called the error
handler with an 'out of memory' message.
*/
+
max_allocation = PRETEND_MEM_SIZE;
almost_exhaust_memory ();
g_print ("Allocated %dK of %dK, %dK free during tests\n",
current_allocation / 1024, max_allocation / 1024,
(max_allocation - current_allocation) / 1024);
- LOWMEMTEST (valid_tiff1_test);
-#if 0
+
+#if 0
+ LOWMEMTEST (valid_tiff1_test);
+#endif
LOWMEMTEST (valid_gif_test);
LOWMEMTEST (valid_png_test);
LOWMEMTEST (valid_jpeg_test);
-#endif
+
return 0;
}